package com.rbac.admin.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 用户实体类
 */
@Data
@TableName("sys_user")
@Tag(name = "SysUser", description = "用户实体类")
public class SysUser implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 用户名
     */
    @Schema(name = "username", description = "用户名")
    private String username;

    /**
     * 密码
     */
    @Schema(name = "password", description = "密码")
    private String password;

    /**
     * 昵称
     */
    @Schema(name = "nickname", description = "昵称")
    private String nickname;

    /**
     * 邮箱
     */
    @Schema(name = "email", description = "邮箱")
    private String email;

    /**
     * 手机号
     */
    @Schema(name = "phone", description = "手机号")
    private String phone;

    /**
     * 性别（0-未知，1-男，2-女）
     */
    @Schema(name = "gender", description = "性别")
    private Integer gender;

    /**
     * 头像地址
     */
    @Schema(name = "avatar", description = "头像地址")
    private String avatar;

    /**
     * 状态（0-禁用，1-正常）
     */
    @Schema(name = "status", description = "状态")
    private Integer status;

    /**
     * 是否删除（0-未删除，1-已删除）
     */
    @Schema(name = "deleted", description = "是否删除")
    @TableLogic
    private Integer deleted;

    /**
     * 创建时间
     */
    @Schema(name = "createTime", description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Schema(name = "updateTime", description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 最后登录时间
     */
    @Schema(name = "lastLoginTime", description = "最后登录时间")
    private LocalDateTime lastLoginTime;

    /**
     * 备注
     */
    @Schema(name = "remark", description = "备注")
    private String remark;
}